<template>

  <div class="order">
    <div class="msg ">
      <div class="order_list">
        <div class="weui-media-box weui-media-box_appmsg" v-for="item in orderDetailList">
          <img src="../../../assets/yishiyong.png" alt=""  width="55" height="55" class="shuiyin" v-if="item.goodState==2">
          <img src="../../../assets/yiguoqi.png" alt=""  width="55" height="55" class="shuiyin" v-if="item.goodState==1">
          <div class="weui-media-box__hd">
            <img :src="item.coverImg | imgPathFilter" alt="" class="weui-media-box__thumb">
          </div>
          <div class="weui-media-box__bd">
            <h4 class="weui-media-box__title">{{item.goodsName}}</h4>
            <p class="weui-media-box__desc">{{item.unitPrice}}元</p>
          </div>
          <span class="num">×{{item.buyNum}}</span>
        </div>
        <!-- <p class="status">
           <button class="weui-btn weui-btn_plain-default">去使用</button>
         </p>-->
      </div>
    </div>

    <div class="divider"></div>
    <ul class="msg">
      <li>订单编号：{{order.orderNo}}</li>
      <li>订单时间：{{order.createDate}}</li>
      <li>支付时间：{{order.payDate}}</li>
      <li v-if="order.payType=='PAY_WX'">支付方式：微信</li>
      <li v-if="order.payType=='PAY_ALI'">支付方式:支付宝</li>
      <li v-if="order.payType=='PAY_UNDERLINE'">支付方式：线下</li>
      <li>支付总额：{{order.totalPrice}}元</li>
    </ul>
    <div class="divider"></div>
    <ul class="msg">
      <li>使用说明：</li>
      <li>订单内如包含以下商品可分别在对应页面查看</li>
      <li>我的特权：菜单栏“我的”——“我的特权”；</li>
      <li>礼品卡：菜单栏“我的”——“礼品卡”；</li>
      <li>贵宾厅、贵宾通道、优惠券等单次商品可在菜单栏“我的”——“待使用”页面查看使用；</li>
    </ul>
  </div>

</template>

<script type="text/ecmascript-6">
  import {getOrderDetail} from '../../../../test/unit/http'
  import {Toast} from 'we-vue'

  export default {
    name: 'allorderdetail',
    props: {},
    data() {
      return {
        isUse: false,
        orderDetailList: [],
        order: {},
        imageBase64QRCode: ''
      };
    },
    methods: {
      getOrderDetailData(params) {
        getOrderDetail(params).then(res => {
          console.log(res);
          if (res.code == 100) {
            this.orderDetailList = res.object.orderDetailList;
            this.order = res.object.order;
            this.imageBase64QRCode = res.object.imageBase64QRCode;
          }
        })
      }
    },
    created() {
      var orderId = this.$route.query.orderId;
      this.getOrderDetailData({orderId: orderId});
    }
  }
</script>

<style scoped lang="less" rel="stylesheet/less">
  .msg{
    position: relative;
    padding:0 10px 10px;
    .order_list{
      position: relative;
      .shuiyin{
        position: absolute;
        top:10px;
        right: 0;
      }
    }
    .order_list:not(:last-of-type){
      padding-bottom: 10px;
      border-bottom: 1px solid #eee;
    }
    .all{
      border-top: 1px solid #eee;
      padding-top: 10px;
      margin-top: 10px;
      .money{
        color: #ff8551;
        float: left;
        margin-top: 5px;
      }
    }
    .state{
      color: #e96774;
      font-size: 12px;
      margin-left: 5px;
    }
    .yuyueing{
      font-size: 10px;
      color: #fff;
      background-color: #ccc;
      border-radius: 25px;
      padding:5px 15px;
      margin-left: 5px;
    }
    .suc{
      background-color: #3095f0;
    }
    .fail{
      background-color: #e96775;
    }
    .num{
      font-size: 15px;
      color: #666;
      margin-top: 35px;
    }
    .status{
      font-size: 12px;
      text-align: right;
      padding-right: 15px;
      .success{
        color: #999;
      }
      .daifu{
        color: #ff8551;
      }
      button{
        border-radius: 25px;
        display: inline-block;
        width: 72px;
        font-size: 15px;
        color: #111;
        margin-left: 10px;
        line-height:1.6
      }
    }
  }
  .weui-btn{
    padding: 0 5px;
  }
  .weui-btn+.weui-btn{
    margin-top: 0;
  }
  .divider{
    background-color: #eee;
    height: 10px;
  }
  .msg{
    padding: 10px;
    font-size: 13px;
    color: #666;
    line-height: 30px;
    text-align: left;
  }
</style>
